package com.wangxiaotao.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 不能被@ComponmentScan所扫描，否则定义的这个配置类就会被所有Ribbon客服端所共享，达不到特殊化的目的
 * @author Wangxiaotao
 * @create 2021-09-08-15:33
 */
@Configuration
public class MySelfRule {

    @Bean
    public IRule myRule(){
        return new RandomRule();//定义为随机
    }
}
